Skip to content

fix(tcp): re-enable stale IPv6 listen/dial integration test#1375

Open
yashksaini-coder wants to merge 2 commits into
libp2p:mainfrom
yashksaini-coder:fix/ipv6-tcp-listen-stale-skip
Open

fix(tcp): re-enable stale IPv6 listen/dial integration test#1375
yashksaini-coder wants to merge 2 commits into
libp2p:mainfrom
yashksaini-coder:fix/ipv6-tcp-listen-stale-skip

Conversation

@yashksaini-coder

Copy link
Copy Markdown
Contributor

Summary

Closes #1189.

Removes a stale @pytest.mark.skip from test_ipv6_tcp_listen_and_dial in tests/core/transport/test_tcp.py.

Why the skip existed: The decorator was added in d8e6455 alongside the initial IPv6 feature. At that point listen() accepted an external nursery parameter, and the external-nursery code path had an IPv6-specific hang (interaction between the pytest-trio nursery and trio.serve_tcp on AF_INET6 sockets).

Why it is now safe to remove: PR #1308 refactored listen() to drop the nursery parameter entirely and switch to trio.lowlevel.spawn_system_task for the internal server loop. That change fixed the root cause. Two other pieces were already in place:

  • multiaddr_from_socket correctly unpacks the 4-tuple (host, port, flowinfo, scope_id) returned by getsockname() on IPv6 sockets (needed for get_addrs())
  • trio.serve_tcp sets IPV6_V6ONLY=1 automatically when it opens an AF_INET6 socket — no extra socket options needed

The skip was never revisited after #1308 landed.

Test plan

  • pytest tests/core/transport/test_tcp.py -k ipv6 — 4 passed
  • pytest tests/core/transport/test_tcp.py — 12 passed
  • make lint clean (ruff, ruff-format)

References

…ibp2p#1189)

The @pytest.mark.skip was added in d8e6455 when listen() took an
external nursery arg — the external-nursery path had an IPv6-specific
hang. PR libp2p#1308 later refactored listen() to use an internal system
task (trio.lowlevel.spawn_system_task), removing the nursery parameter
entirely and fixing the root cause. The skip was never revisited.

Remove the decorator and the stale TODO comment. The test now passes in
~40ms; all 12 TCP transport tests remain green.
@yashksaini-coder

Copy link
Copy Markdown
Contributor Author

@acul71 please check this small update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: IPv6 listener hangs in integration test

1 participant